home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / smallt~1 / smallt~1.zoo / mst.tab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-26  |  32.0 KB  |  1,075 lines

  1.  
  2. /*  A Bison parser, made from mst.y  */
  3.  
  4. #define    BANG    258
  5. #define    COLON    259
  6. #define    UPARROW    260
  7. #define    DOT    261
  8. #define    ASSIGN    262
  9. #define    SHARP    263
  10. #define    SEMICOLON    264
  11. #define    OPEN_PAREN    265
  12. #define    CLOSE_PAREN    266
  13. #define    OPEN_BRACKET    267
  14. #define    CLOSE_BRACKET    268
  15. #define    PRIMITIVE_START    269
  16. #define    INTERNAL_TOKEN    270
  17. #define    IDENTIFIER    271
  18. #define    KEYWORD    272
  19. #define    STRING_LITERAL    273
  20. #define    SYMBOL_KEYWORD    274
  21. #define    BINOP    275
  22. #define    VERTICAL_BAR    276
  23. #define    INTEGER_LITERAL    277
  24. #define    FLOATING_LITERAL    278
  25. #define    CHAR_LITERAL    279
  26.  
  27. #line 26 "mst.y"
  28.  
  29. #include "mst.h"
  30. #include "mstsym.h"
  31. #include "msttree.h"
  32. #include "mstdict.h"
  33. #include <stdio.h>
  34. #ifdef HAS_ALLOCA_H
  35. #include <alloca.h>
  36. #endif
  37.  
  38. #define YYDEBUG 1
  39.  
  40. extern Boolean        quietExecution;
  41.  
  42. /*int yynerr;            /* hack around Bison bug for pure parser */
  43. /*int yydebug = 0;        /* hack around Bison bug for pure parser */
  44.  
  45. #line 46 "mst.y"
  46. typedef union{
  47.   char        cval;
  48.   double    fval;
  49.   long        ival;
  50.   char        *sval;
  51.   TreeNode    node;
  52. } YYSTYPE;
  53.  
  54. #ifndef YYLTYPE
  55. typedef
  56.   struct yyltype
  57.     {
  58.       int timestamp;
  59.       int first_line;
  60.       int first_column;
  61.       int last_line;
  62.       int last_column;
  63.       char *text;
  64.    }
  65.   yyltype;
  66.  
  67. #define YYLTYPE yyltype
  68. #endif
  69.  
  70. #include <stdio.h>
  71.  
  72. #ifndef __STDC__
  73. #define const
  74. #endif
  75.  
  76.  
  77.  
  78. #define    YYFINAL        146
  79. #define    YYFLAG        -32768
  80. #define    YYNTBASE    25
  81.  
  82. #define YYTRANSLATE(x) ((unsigned)(x) <= 279 ? yytranslate[x] : 71)
  83.  
  84. static const char yytranslate[] = {     0,
  85.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  86.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  87.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  88.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  89.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  90.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  91.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  92.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  93.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  94.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  95.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  96.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  97.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  98.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  99.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  100.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  101.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  102.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  103.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  104.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  105.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  106.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  107.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  108.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  109.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  110.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  111.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  112.     16,    17,    18,    19,    20,    21,    22,    23,    24
  113. };
  114.  
  115. static const short yyrline[] = {     0,
  116.     81,    83,    86,    89,    91,    94,    96,    97,   103,   110,
  117.    113,   117,   150,   158,   167,   170,   172,   174,   179,   181,
  118.    183,   184,   189,   193,   195,   198,   202,   204,   209,   213,
  119.    221,   223,   227,   229,   233,   235,   238,   242,   243,   246,
  120.    253,   255,   258,   260,   265,   267,   268,   271,   273,   274,
  121.    275,   278,   280,   281,   282,   283,   286,   288,   291,   295,
  122.    297,   298,   299,   303,   307,   311,   315,   317,   321,   323,
  123.    328,   330,   331,   332,   333,   336,   341,   343,   349,   351,
  124.    356,   358,   359,   362,   366,   368,   371,   376,   378,   381,
  125.    386,   389,   394,   399,   401,   406,   408,   410
  126. };
  127.  
  128. static const char * const yytname[] = {     0,
  129. "error","$illegal.","BANG","COLON","UPARROW","DOT","ASSIGN","SHARP","SEMICOLON","OPEN_PAREN",
  130. "CLOSE_PAREN","OPEN_BRACKET","CLOSE_BRACKET","PRIMITIVE_START","INTERNAL_TOKEN","IDENTIFIER","KEYWORD","STRING_LITERAL","SYMBOL_KEYWORD","BINOP",
  131. "VERTICAL_BAR","INTEGER_LITERAL","FLOATING_LITERAL","CHAR_LITERAL","program"
  132. };
  133.  
  134. static const short yyr1[] = {     0,
  135.     25,    25,    26,    27,    27,    28,    28,    28,    28,    28,
  136.     29,    30,    31,    31,    32,    32,    32,    32,    33,    33,
  137.     33,    33,    34,    35,    35,    36,    37,    37,    38,    39,
  138.     40,    40,    41,    41,    42,    42,    43,    43,    43,    43,
  139.     44,    44,    45,    45,    46,    46,    46,    47,    47,    47,
  140.     47,    48,    48,    48,    48,    48,    49,    49,    50,    51,
  141.     51,    51,    51,    52,    53,    54,    55,    55,    56,    56,
  142.     57,    57,    57,    57,    57,    58,    59,    59,    60,    60,
  143.     61,    61,    61,    62,    63,    63,    64,    65,    65,    66,
  144.     67,    67,    68,    69,    69,    70,    70,    70
  145. };
  146.  
  147. static const short yyr2[] = {     0,
  148.      1,     2,     1,     1,     2,     3,     2,     2,     3,     2,
  149.      3,     1,     2,     3,     2,     3,     3,     4,     1,     2,
  150.      1,     1,     1,     1,     1,     1,     2,     3,     1,     3,
  151.      2,     3,     1,     2,     0,     1,     2,     1,     3,     3,
  152.      1,     2,     2,     3,     1,     1,     1,     1,     1,     1,
  153.      3,     1,     1,     1,     1,     1,     1,     1,     2,     1,
  154.      1,     1,     1,     1,     1,     2,     2,     3,     1,     2,
  155.      1,     1,     1,     1,     1,     4,     0,     2,     2,     3,
  156.      1,     1,     1,     2,     1,     1,     3,     1,     1,     2,
  157.      2,     3,     2,     2,     3,     1,     2,     1
  158. };
  159.  
  160. static const short yydefact[] = {     0,
  161.      0,     0,     0,     0,     0,    77,     3,    26,    65,     0,
  162.     57,    58,    64,     0,     0,     4,     0,    48,     0,     0,
  163.     38,     0,    41,    45,    49,    52,    53,    54,    55,    56,
  164.     50,    46,    81,    88,    82,     0,    83,    47,    10,     0,
  165.      0,    48,    12,    37,     0,    60,    63,    62,    24,    25,
  166.     61,    59,    66,     0,     0,     0,     0,    31,    33,     0,
  167.     22,    23,    29,     2,     0,    19,     0,    21,     0,     5,
  168.      7,     0,     0,    43,     0,     0,     8,     0,    48,    42,
  169.      0,    93,    84,     0,     0,    90,    40,    36,    11,    67,
  170.     71,    72,    74,    73,    75,     0,    69,    51,    79,     0,
  171.      0,    78,    32,    34,     0,     0,     0,    15,    20,     0,
  172.     27,     6,     0,    13,     9,    39,    44,    96,     0,    98,
  173.     94,     0,    85,    86,    87,    89,    91,     0,    68,    70,
  174.     76,    80,     0,    17,     0,    16,    28,    14,    97,    95,
  175.     92,    30,    18,     0,     0,     0
  176. };
  177.  
  178. static const short yydefgoto[] = {   144,
  179.     14,    15,    16,    17,    41,    72,    64,    65,    66,    51,
  180.     18,    68,    69,   106,    19,    60,    87,    88,    21,    22,
  181.     23,    24,    25,    26,    27,    92,    28,    29,    30,    95,
  182.     96,    97,    31,    56,    57,    32,    33,    34,    35,    36,
  183.     37,   120,    38,    82,   121
  184. };
  185.  
  186. static const short yypact[] = {   247,
  187.     44,   294,   294,   339,   294,    36,-32768,-32768,-32768,    22,
  188. -32768,-32768,-32768,    98,   148,-32768,    15,    39,   291,    49,
  189.     64,   294,-32768,    57,-32768,-32768,-32768,-32768,-32768,-32768,
  190. -32768,    56,    59,    66,    90,   142,-32768,-32768,-32768,   173,
  191.     82,-32768,-32768,-32768,   309,-32768,-32768,-32768,-32768,-32768,
  192. -32768,-32768,-32768,    77,    74,   271,    16,-32768,-32768,    28,
  193. -32768,-32768,-32768,-32768,   123,-32768,    74,    81,    74,-32768,
  194. -32768,    80,    88,-32768,    96,    91,-32768,   173,    97,-32768,
  195.    257,   100,-32768,   294,   294,    81,-32768,-32768,-32768,-32768,
  196. -32768,-32768,-32768,-32768,-32768,   324,-32768,-32768,-32768,    92,
  197.     74,-32768,-32768,-32768,    94,   223,   198,-32768,-32768,    74,
  198. -32768,-32768,   114,-32768,-32768,-32768,-32768,-32768,   294,    81,
  199. -32768,   257,-32768,-32768,    66,-32768,    13,   294,-32768,-32768,
  200. -32768,-32768,   102,-32768,   223,-32768,-32768,-32768,    66,-32768,
  201.     13,-32768,-32768,   120,   125,-32768
  202. };
  203.  
  204. static const short yypgoto[] = {-32768,
  205. -32768,-32768,   117,-32768,-32768,-32768,   -11,-32768,   -33,   -14,
  206.      2,-32768,   -27,    27,    71,-32768,   -51,    11,    18,-32768,
  207.     17,   -77,-32768,   -43,-32768,   134,   -32,   -30,-32768,   136,
  208. -32768,    33,-32768,-32768,-32768,-32768,   -56,   -74,   -68,   -60,
  209. -32768,   106,-32768,-32768,    21
  210. };
  211.  
  212.  
  213. #define    YYLAST        360
  214.  
  215.  
  216. static const short yytable[] = {    67,
  217.     83,    91,    67,    42,   100,    73,   123,   123,    85,   125,
  218.     20,    59,    93,   108,    94,    61,   126,    71,    43,   101,
  219.     44,    84,    54,    79,   127,    20,   116,   124,   124,    76,
  220.     62,    63,    49,    50,    49,    50,   102,     8,    80,    55,
  221.    110,   123,    58,     8,   139,    74,    39,   118,   103,    40,
  222.    123,    77,    91,    85,   134,   136,    99,    67,   128,   126,
  223.    113,   104,   124,    93,    81,    94,   119,   141,   109,    78,
  224.    111,   124,   -85,   -85,   -86,   -86,   -85,   -85,   -86,   -86,
  225.     61,    62,   112,   143,    89,    42,    42,    98,   118,     8,
  226.    114,    83,   128,   115,    85,    62,    63,    63,    61,    49,
  227.     50,    40,   132,   117,   131,    83,   -89,   119,   122,   -89,
  228.    -89,   137,    84,    62,    63,   133,   138,    49,    50,   145,
  229.     42,   142,   -35,    75,   146,   -35,    84,     3,   130,    42,
  230.      4,    70,     5,   135,     6,   107,   105,    52,     8,    53,
  231.      9,    86,   140,    10,    11,    12,    13,    -1,     1,     0,
  232.      2,     0,     3,     0,     0,     4,     0,     5,    63,     6,
  233.      0,    49,    50,     8,     0,     9,     0,     0,    10,    11,
  234.     12,    13,   -35,    75,     0,   -35,     0,     3,     0,     0,
  235.      4,     0,     5,     0,     6,   -35,     0,     0,     8,     0,
  236.      9,     0,     0,     0,    11,    12,    13,   -35,    75,     0,
  237.    -35,     0,     3,     0,     0,     4,     0,     5,     0,     6,
  238.      0,   105,     0,     8,     0,     9,     0,     0,     0,    11,
  239.     12,    13,   -35,    75,     0,   -35,     0,     3,     0,     0,
  240.      4,     0,     5,     0,     6,     0,     0,     0,     8,     0,
  241.      9,     0,     0,     0,    11,    12,    13,     1,     0,     2,
  242.      0,     3,     0,     0,     4,     0,     5,     0,     6,     0,
  243.      0,     7,     8,     0,     9,     0,     0,    10,    11,    12,
  244.     13,    75,    62,    63,     0,     3,    49,    50,     4,     0,
  245.      5,     0,     6,   -35,     0,     0,     8,     0,     9,     0,
  246.      0,    75,    11,    12,    13,     3,     0,     0,     4,     0,
  247.      5,     4,     6,     5,     0,     6,     8,     0,     9,     8,
  248.      0,     9,    11,    12,    13,    11,    12,    13,    45,    90,
  249.      0,     0,     0,     0,    46,    47,     9,    48,    49,    50,
  250.     11,    12,    13,    45,   129,     0,     0,     0,     0,    46,
  251.     47,     9,    48,    49,    50,    11,    12,    13,    45,     0,
  252.      0,     0,     0,     0,    46,    47,     0,    48,    49,    50
  253. };
  254.  
  255. static const short yycheck[] = {    14,
  256.     34,    45,    17,     2,    56,    17,    84,    85,    36,    84,
  257.      0,    10,    45,    65,    45,     1,    85,     3,     2,     4,
  258.      3,    36,     5,    22,    85,    15,    78,    84,    85,    19,
  259.     16,    17,    20,    21,    20,    21,    21,    16,    22,     4,
  260.     68,   119,    21,    16,   119,     7,     3,    81,    21,     6,
  261.    128,     3,    96,    81,   106,   107,    55,    72,    86,   128,
  262.     72,    60,   119,    96,     9,    96,    81,   128,    67,     6,
  263.     69,   128,    16,    17,    16,    17,    20,    21,    20,    21,
  264.      1,    16,     3,   135,     3,    84,    85,    11,   122,    16,
  265.      3,   125,   120,     3,   122,    16,    17,    17,     1,    20,
  266.     21,     6,   101,     7,    13,   139,    17,   122,     9,    20,
  267.     21,   110,   127,    16,    17,    22,     3,    20,    21,     0,
  268.    119,    20,     0,     1,     0,     3,   141,     5,    96,   128,
  269.      8,    15,    10,   107,    12,    65,    14,     4,    16,     4,
  270.     18,    36,   122,    21,    22,    23,    24,     0,     1,    -1,
  271.      3,    -1,     5,    -1,    -1,     8,    -1,    10,    17,    12,
  272.     -1,    20,    21,    16,    -1,    18,    -1,    -1,    21,    22,
  273.     23,    24,     0,     1,    -1,     3,    -1,     5,    -1,    -1,
  274.      8,    -1,    10,    -1,    12,    13,    -1,    -1,    16,    -1,
  275.     18,    -1,    -1,    -1,    22,    23,    24,     0,     1,    -1,
  276.      3,    -1,     5,    -1,    -1,     8,    -1,    10,    -1,    12,
  277.     -1,    14,    -1,    16,    -1,    18,    -1,    -1,    -1,    22,
  278.     23,    24,     0,     1,    -1,     3,    -1,     5,    -1,    -1,
  279.      8,    -1,    10,    -1,    12,    -1,    -1,    -1,    16,    -1,
  280.     18,    -1,    -1,    -1,    22,    23,    24,     1,    -1,     3,
  281.     -1,     5,    -1,    -1,     8,    -1,    10,    -1,    12,    -1,
  282.     -1,    15,    16,    -1,    18,    -1,    -1,    21,    22,    23,
  283.     24,     1,    16,    17,    -1,     5,    20,    21,     8,    -1,
  284.     10,    -1,    12,    13,    -1,    -1,    16,    -1,    18,    -1,
  285.     -1,     1,    22,    23,    24,     5,    -1,    -1,     8,    -1,
  286.     10,     8,    12,    10,    -1,    12,    16,    -1,    18,    16,
  287.     -1,    18,    22,    23,    24,    22,    23,    24,    10,    11,
  288.     -1,    -1,    -1,    -1,    16,    17,    18,    19,    20,    21,
  289.     22,    23,    24,    10,    11,    -1,    -1,    -1,    -1,    16,
  290.     17,    18,    19,    20,    21,    22,    23,    24,    10,    -1,
  291.     -1,    -1,    -1,    -1,    16,    17,    -1,    19,    20,    21
  292. };
  293. #define YYIMPURE 1
  294.  
  295. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  296. #line 3 "bison.simple"
  297.  
  298. /* Skeleton output parser for bison,
  299.    Copyright (C) 1984 Bob Corbett and Richard Stallman
  300.  
  301.    This program is free software; you can redistribute it and/or modify
  302.    it under the terms of the GNU General Public License as published by
  303.    the Free Software Foundation; either version 1, or (at your option)
  304.    any later version.
  305.  
  306.    This program is distributed in the hope that it will be useful,
  307.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  308.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  309.    GNU General Public License for more details.
  310.  
  311.    You should have received a copy of the GNU General Public License
  312.    along with this program; if not, write to the Free Software
  313.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  314.  
  315.  
  316. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  317. #include <alloca.h>
  318. #endif
  319.  
  320. /* This is the parser code that is written into each bison parser
  321.   when the %semantic_parser declaration is not specified in the grammar.
  322.   It was written by Richard Stallman by simplifying the hairy parser
  323.   used when %semantic_parser is specified.  */
  324.  
  325. /* Note: there must be only one dollar sign in this file.
  326.    It is replaced by the list of actions, each action
  327.    as one case of the switch.  */
  328.  
  329. #define yyerrok        (yyerrstatus = 0)
  330. #define yyclearin    (yychar = YYEMPTY)
  331. #define YYEMPTY        -2
  332. #define YYEOF        0
  333. #define YYFAIL        goto yyerrlab;
  334. #define YYACCEPT    return(0)
  335. #define YYABORT     return(1)
  336. #define YYERROR        goto yyerrlab
  337.  
  338. #define YYTERROR    1
  339. #define YYERRCODE    256
  340.  
  341. #ifndef YYIMPURE
  342. #define YYLEX        yylex()
  343. #endif
  344.  
  345. #ifndef YYPURE
  346. #define YYLEX        yylex(&yylval, &yylloc)
  347. #endif
  348.  
  349. /* If nonreentrant, generate the variables here */
  350.  
  351. #ifndef YYIMPURE
  352.  
  353. int    yychar;            /*  the lookahead symbol        */
  354. YYSTYPE    yylval;            /*  the semantic value of the        */
  355.                 /*  lookahead symbol            */
  356.  
  357. YYLTYPE yylloc;            /*  location data for the lookahead    */
  358.                 /*  symbol                */
  359.  
  360. int yynerrs;            /*  number of parse errors so far       */
  361. #endif  /* YYIMPURE */
  362.  
  363. #if YYDEBUG != 0
  364. int yydebug;            /*  nonzero means print parse trace    */
  365. /* Since this is uninitialized, it does not stop multiple parsers
  366.    from coexisting.  */
  367. #endif
  368.  
  369. /*  YYMAXDEPTH indicates the initial size of the parser's stacks    */
  370.  
  371. #ifndef    YYMAXDEPTH
  372. #define YYMAXDEPTH 200
  373. #endif
  374.  
  375. /*  YYMAXLIMIT is the maximum size the stacks can grow to
  376.     (effective only if the built-in stack extension method is used).  */
  377.  
  378. #ifndef YYMAXLIMIT
  379. #define YYMAXLIMIT 10000
  380. #endif
  381.  
  382.  
  383. #line 90 "bison.simple"
  384. int
  385. yyparse()
  386. {
  387.   register int yystate;
  388.   register int yyn;
  389.   register short *yyssp;
  390.   register YYSTYPE *yyvsp;
  391.   YYLTYPE *yylsp;
  392.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  393.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  394.  
  395.   short    yyssa[YYMAXDEPTH];    /*  the state stack            */
  396.   YYSTYPE yyvsa[YYMAXDEPTH];    /*  the semantic value stack        */
  397.   YYLTYPE yylsa[YYMAXDEPTH];    /*  the location stack            */
  398.  
  399.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  400.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  401.   YYLTYPE *yyls = yylsa;
  402.  
  403.   int yymaxdepth = YYMAXDEPTH;
  404.  
  405. #ifndef YYPURE
  406.   int yychar;
  407.   YYSTYPE yylval;
  408.   YYLTYPE yylloc;
  409.   int yynerrs;
  410. #endif
  411.  
  412.   YYSTYPE yyval;        /*  the variable used to return        */
  413.                 /*  semantic values from the action    */
  414.                 /*  routines                */
  415.  
  416.   int yylen;
  417.  
  418. #if YYDEBUG != 0
  419.   if (yydebug)
  420.     fprintf(stderr, "Starting parse\n");
  421. #endif
  422.  
  423.   yystate = 0;
  424.   yyerrstatus = 0;
  425.   yynerrs = 0;
  426.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  427.  
  428.   /* Initialize stack pointers.
  429.      Waste one element of value and location stack
  430.      so that they stay on the same level as the state stack.  */
  431.  
  432.   yyssp = yyss - 1;
  433.   yyvsp = yyvs;
  434.   yylsp = yyls;
  435.  
  436. /* Push a new state, which is found in  yystate  .  */
  437. /* In all cases, when you get here, the value and location stacks
  438.    have just been pushed. so pushing a state here evens the stacks.  */
  439. yynewstate:
  440.  
  441.   *++yyssp = yystate;
  442.  
  443.   if (yyssp >= yyss + yymaxdepth - 1)
  444.     {
  445.       /* Give user a chance to reallocate the stack */
  446.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  447.       YYSTYPE *yyvs1 = yyvs;
  448.       YYLTYPE *yyls1 = yyls;
  449.       short *yyss1 = yyss;
  450.  
  451.       /* Get the current used size of the three stacks, in elements.  */
  452.       int size = yyssp - yyss + 1;
  453.  
  454. #ifdef yyoverflow
  455.       /* Each stack pointer address is followed by the size of
  456.      the data in use in that stack, in bytes.  */
  457.       yyoverflow("parser stack overflow",
  458.          &yyss1, size * sizeof (*yyssp),
  459.          &yyvs1, size * sizeof (*yyvsp),
  460.          &yyls1, size * sizeof (*yylsp),
  461.          &yymaxdepth);
  462.  
  463.       yyss = yyss1; yyvs = yyvs1; yyls = yyls1;
  464. #else /* no yyoverflow */
  465.       /* Extend the stack our own way.  */
  466.       if (yymaxdepth >= YYMAXLIMIT)
  467.     yyerror("parser stack overflow");
  468.       yymaxdepth *= 2;
  469.       if (yymaxdepth > YYMAXLIMIT)
  470.     yymaxdepth = YYMAXLIMIT;
  471.       yyss = (short *) alloca (yymaxdepth * sizeof (*yyssp));
  472.       bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  473.       yyvs = (YYSTYPE *) alloca (yymaxdepth * sizeof (*yyvsp));
  474.       bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  475. #ifdef YYLSP_NEEDED
  476.       yyls = (YYLTYPE *) alloca (yymaxdepth * sizeof (*yylsp));
  477.       bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  478. #endif
  479. #endif /* no yyoverflow */
  480.  
  481.       yyssp = yyss + size - 1;
  482.       yyvsp = yyvs + size - 1;
  483. #ifdef YYLSP_NEEDED
  484.       yylsp = yyls + size - 1;
  485. #endif
  486.  
  487. #if YYDEBUG != 0
  488.       if (yydebug)
  489.     fprintf(stderr, "Stack size increased to %d\n", yymaxdepth);
  490. #endif
  491.  
  492.       if (yyssp >= yyss + yymaxdepth - 1)
  493.     YYABORT;
  494.     }
  495.  
  496. #if YYDEBUG != 0
  497.   if (yydebug)
  498.     fprintf(stderr, "Entering state %d\n", yystate);
  499. #endif
  500.  
  501. /* Do appropriate processing given the current state.  */
  502. /* Read a lookahead token if we need one and don't already have one.  */
  503. yyresume:
  504.  
  505.   /* First try to decide what to do without reference to lookahead token.  */
  506.  
  507.   yyn = yypact[yystate];
  508.   if (yyn == YYFLAG)
  509.     goto yydefault;
  510.  
  511.   /* Not known => get a lookahead token if don't already have one.  */
  512.  
  513.   /* yychar is either YYEMPTY or YYEOF
  514.      or a valid token in external form.  */
  515.  
  516.   if (yychar == YYEMPTY)
  517.     {
  518. #if YYDEBUG != 0
  519.       if (yydebug)
  520.     fprintf(stderr, "Reading a token: ");
  521. #endif
  522.       yychar = YYLEX;
  523.     }
  524.  
  525.   /* Convert token to internal form (in yychar1) for indexing tables with */
  526.  
  527.   if (yychar <= 0)        /* This means end of input. */
  528.     {
  529.       yychar1 = 0;
  530.       yychar = YYEOF;        /* Don't call YYLEX any more */
  531.  
  532. #if YYDEBUG != 0
  533.       if (yydebug)
  534.     fprintf(stderr, "Now at end of input.\n");
  535. #endif
  536.     }
  537.   else
  538.     {
  539.       yychar1 = YYTRANSLATE(yychar);
  540.  
  541. #if YYDEBUG != 0
  542.       if (yydebug)
  543.     fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  544. #endif
  545.     }
  546.  
  547.   yyn += yychar1;
  548.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  549.     goto yydefault;
  550.  
  551.   yyn = yytable[yyn];
  552.  
  553.   /* yyn is what to do for this token type in this state.
  554.      Negative => reduce, -yyn is rule number.
  555.      Positive => shift, yyn is new state.
  556.        New state is final state => don't bother to shift,
  557.        just return success.
  558.      0, or most negative number => error.  */
  559.  
  560.   if (yyn < 0)
  561.     {
  562.       if (yyn == YYFLAG)
  563.     goto yyerrlab;
  564.       yyn = -yyn;
  565.       goto yyreduce;
  566.     }
  567.   else if (yyn == 0)
  568.     goto yyerrlab;
  569.  
  570.   if (yyn == YYFINAL)
  571.     YYACCEPT;
  572.  
  573.   /* Shift the lookahead token.  */
  574.  
  575. #if YYDEBUG != 0
  576.   if (yydebug)
  577.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  578. #endif
  579.  
  580.   /* Discard the token being shifted unless it is eof.  */
  581.   if (yychar != YYEOF)
  582.     yychar = YYEMPTY;
  583.  
  584.   *++yyvsp = yylval;
  585. #ifdef YYLSP_NEEDED
  586.   *++yylsp = yylloc;
  587. #endif
  588.  
  589.   /* count tokens shifted since error; after three, turn off error status.  */
  590.   if (yyerrstatus) yyerrstatus--;
  591.  
  592.   yystate = yyn;
  593.   goto yynewstate;
  594.  
  595. /* Do the default action for the current state.  */
  596. yydefault:
  597.  
  598.   yyn = yydefact[yystate];
  599.   if (yyn == 0)
  600.     goto yyerrlab;
  601.  
  602. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  603. yyreduce:
  604.   yylen = yyr2[yyn];
  605.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  606.  
  607. #if YYDEBUG != 0
  608.   if (yydebug)
  609.     {
  610.       if (yylen == 1)
  611.     fprintf (stderr, "Reducing 1 value via line %d, ",
  612.          yyrline[yyn]);
  613.       else
  614.     fprintf (stderr, "Reducing %d values via line %d, ",
  615.          yylen, yyrline[yyn]);
  616.     }
  617. #endif
  618.  
  619.  
  620.   switch (yyn) {
  621.  
  622. case 2:
  623. #line 83 "mst.y"
  624. { compileMethod(yyvsp[0].node); ;
  625.     break;}
  626. case 3:
  627. #line 87 "mst.y"
  628. { clearMethodStartPos(); ;
  629.     break;}
  630. case 8:
  631. #line 97 "mst.y"
  632. { if (!hadError) {
  633.                         executeStatements(nil, yyvsp[-1].node,
  634.                                 quietExecution); 
  635.                       }
  636.                       hadError = false;
  637.                     ;
  638.     break;}
  639. case 9:
  640. #line 104 "mst.y"
  641. { if (!hadError) {
  642.                         executeStatements(yyvsp[-2].node, yyvsp[-1].node,
  643.                                 quietExecution); 
  644.                                           }
  645.                       hadError = false;
  646.                                         ;
  647.     break;}
  648. case 10:
  649. #line 110 "mst.y"
  650. { hadError = false; ;
  651.     break;}
  652. case 11:
  653. #line 114 "mst.y"
  654. { clearMethodStartPos(); ;
  655.     break;}
  656. case 12:
  657. #line 118 "mst.y"
  658. { executeStatements(nil, 
  659.                     makeStatementList(yyvsp[0].node, nil), true); ;
  660.     break;}
  661. case 13:
  662. #line 151 "mst.y"
  663. { if (!hadError) {
  664.                         compileMethod(yyvsp[-1].node);
  665.                         clearMethodStartPos();
  666.                       } else {
  667.                         hadError = false;
  668.                       }
  669.                     ;
  670.     break;}
  671. case 14:
  672. #line 158 "mst.y"
  673. { if (!hadError) {
  674.                         compileMethod(yyvsp[-1].node);
  675.                         clearMethodStartPos();
  676.                       } else {
  677.                         hadError = false;
  678.                       }
  679.                     ;
  680.     break;}
  681. case 15:
  682. #line 169 "mst.y"
  683. { yyval.node = makeMethod(yyvsp[-1].node, nil, 0, yyvsp[0].node); ;
  684.     break;}
  685. case 16:
  686. #line 171 "mst.y"
  687. { yyval.node = makeMethod(yyvsp[-2].node, yyvsp[-1].node, 0, yyvsp[0].node); ;
  688.     break;}
  689. case 17:
  690. #line 173 "mst.y"
  691. { yyval.node = makeMethod(yyvsp[-2].node, nil, yyvsp[-1].ival, yyvsp[0].node); ;
  692.     break;}
  693. case 18:
  694. #line 175 "mst.y"
  695. { yyval.node = makeMethod(yyvsp[-3].node, yyvsp[-2].node, yyvsp[-1].ival, yyvsp[0].node); ;
  696.     break;}
  697. case 19:
  698. #line 180 "mst.y"
  699. { yyval.node = makeUnaryExpr(nil, yyvsp[0].sval); ;
  700.     break;}
  701. case 20:
  702. #line 181 "mst.y"
  703. { yyval.node = makeBinaryExpr(nil, yyvsp[-1].sval,
  704.                                       yyvsp[0].node); ;
  705.     break;}
  706. case 21:
  707. #line 183 "mst.y"
  708. { yyval.node = makeKeywordExpr(nil, yyvsp[0].node); ;
  709.     break;}
  710. case 22:
  711. #line 184 "mst.y"
  712. { errorf("Invalid message pattern");
  713.                       hadError = true;
  714.                       yyval.node = nil; ;
  715.     break;}
  716. case 26:
  717. #line 199 "mst.y"
  718. { yyval.node = makeVariable(yyvsp[0].sval); ;
  719.     break;}
  720. case 27:
  721. #line 203 "mst.y"
  722. { yyval.node = makeKeywordList(yyvsp[-1].sval, yyvsp[0].node); ;
  723.     break;}
  724. case 28:
  725. #line 205 "mst.y"
  726. { addNode(yyvsp[-2].node, makeKeywordList(yyvsp[-1].sval, yyvsp[0].node));
  727.                       yyval.node = yyvsp[-2].node; ;
  728.     break;}
  729. case 30:
  730. #line 215 "mst.y"
  731. { yyval.ival = yyvsp[-1].ival;
  732.                       if (strcmp(yyvsp[0].sval, ">") != 0) {
  733.                         YYERROR;
  734.                       }
  735.                     ;
  736.     break;}
  737. case 31:
  738. #line 222 "mst.y"
  739. { yyval.node = nil; ;
  740.     break;}
  741. case 32:
  742. #line 224 "mst.y"
  743. { yyval.node = yyvsp[-1].node; ;
  744.     break;}
  745. case 33:
  746. #line 228 "mst.y"
  747. { yyval.node = makeVariableList(yyvsp[0].node); ;
  748.     break;}
  749. case 34:
  750. #line 229 "mst.y"
  751. { addNode(yyvsp[-1].node, makeVariableList(yyvsp[0].node));
  752.                       yyval.node = yyvsp[-1].node; ;
  753.     break;}
  754. case 35:
  755. #line 234 "mst.y"
  756. { yyval.node = nil; ;
  757.     break;}
  758. case 37:
  759. #line 240 "mst.y"
  760. { yyval.node = makeStatementList(makeReturn(yyvsp[0].node),
  761.                                    nil); ;
  762.     break;}
  763. case 38:
  764. #line 242 "mst.y"
  765. { yyval.node = makeStatementList(yyvsp[0].node, nil); ;
  766.     break;}
  767. case 39:
  768. #line 245 "mst.y"
  769. { yyval.node = makeStatementList(yyvsp[-2].node, yyvsp[0].node); ;
  770.     break;}
  771. case 40:
  772. #line 246 "mst.y"
  773. { yyval.node = yyvsp[0].node;
  774.                   yyerrok;
  775.                   errorf("Error in expression");
  776.                   hadError = true;
  777.                 ;
  778.     break;}
  779. case 42:
  780. #line 255 "mst.y"
  781. { yyval.node = makeAssign(yyvsp[-1].node, yyvsp[0].node); ;
  782.     break;}
  783. case 43:
  784. #line 259 "mst.y"
  785. { yyval.node = makeVariableList(yyvsp[-1].node); ;
  786.     break;}
  787. case 44:
  788. #line 261 "mst.y"
  789. { addNode(yyvsp[-2].node, makeVariableList(yyvsp[-1].node));
  790.                       yyval.node = yyvsp[-2].node; ;
  791.     break;}
  792. case 51:
  793. #line 275 "mst.y"
  794. { yyval.node = yyvsp[-1].node; ;
  795.     break;}
  796. case 57:
  797. #line 287 "mst.y"
  798. { yyval.node = makeIntConstant(yyvsp[0].ival); ;
  799.     break;}
  800. case 58:
  801. #line 288 "mst.y"
  802. { yyval.node = makeFloatConstant(yyvsp[0].fval); ;
  803.     break;}
  804. case 59:
  805. #line 292 "mst.y"
  806. { yyval.node = makeSymbolConstant(yyvsp[0].node); ;
  807.     break;}
  808. case 60:
  809. #line 296 "mst.y"
  810. { yyval.node = internIdent(yyvsp[0].sval); ;
  811.     break;}
  812. case 61:
  813. #line 297 "mst.y"
  814. { yyval.node = internBinOP(yyvsp[0].sval); ;
  815.     break;}
  816. case 62:
  817. #line 298 "mst.y"
  818. { yyval.node = internIdent(yyvsp[0].sval); ;
  819.     break;}
  820. case 63:
  821. #line 299 "mst.y"
  822. { yyval.node = internIdent(yyvsp[0].sval); ;
  823.     break;}
  824. case 64:
  825. #line 304 "mst.y"
  826. { yyval.node = makeCharConstant(yyvsp[0].cval); ;
  827.     break;}
  828. case 65:
  829. #line 308 "mst.y"
  830. { yyval.node = makeStringConstant(yyvsp[0].sval); ;
  831.     break;}
  832. case 66:
  833. #line 312 "mst.y"
  834. { yyval.node = makeArrayConstant(yyvsp[0].node); ;
  835.     break;}
  836. case 67:
  837. #line 316 "mst.y"
  838. { yyval.node = nil; ;
  839.     break;}
  840. case 68:
  841. #line 318 "mst.y"
  842. { yyval.node = yyvsp[-1].node; ;
  843.     break;}
  844. case 69:
  845. #line 322 "mst.y"
  846. { yyval.node = makeArrayElt(yyvsp[0].node); ;
  847.     break;}
  848. case 70:
  849. #line 324 "mst.y"
  850. { addNode(yyvsp[-1].node, makeArrayElt(yyvsp[0].node));
  851.                       yyval.node = yyvsp[-1].node; ;
  852.     break;}
  853. case 76:
  854. #line 338 "mst.y"
  855. { yyval.node = makeBlock(yyvsp[-2].node, yyvsp[-1].node); ;
  856.     break;}
  857. case 77:
  858. #line 342 "mst.y"
  859. { yyval.node = nil; ;
  860.     break;}
  861. case 79:
  862. #line 350 "mst.y"
  863. { yyval.node = makeVariableList(yyvsp[0].node); ;
  864.     break;}
  865. case 80:
  866. #line 352 "mst.y"
  867. { addNode(yyvsp[-2].node, makeVariableList(yyvsp[0].node));
  868.                       yyval.node = yyvsp[-2].node; ;
  869.     break;}
  870. case 84:
  871. #line 363 "mst.y"
  872. { yyval.node = makeUnaryExpr(yyvsp[-1].node, yyvsp[0].sval); ;
  873.     break;}
  874. case 87:
  875. #line 373 "mst.y"
  876. { yyval.node = makeBinaryExpr(yyvsp[-2].node, yyvsp[-1].sval, yyvsp[0].node); ;
  877.     break;}
  878. case 90:
  879. #line 383 "mst.y"
  880. { yyval.node = makeKeywordExpr(yyvsp[-1].node, yyvsp[0].node); ;
  881.     break;}
  882. case 91:
  883. #line 388 "mst.y"
  884. { yyval.node = makeKeywordList(yyvsp[-1].sval, yyvsp[0].node); ;
  885.     break;}
  886. case 92:
  887. #line 390 "mst.y"
  888. { addNode(yyvsp[-2].node, makeKeywordList(yyvsp[-1].sval, yyvsp[0].node));
  889.                       yyval.node = yyvsp[-2].node; ;
  890.     break;}
  891. case 93:
  892. #line 396 "mst.y"
  893. { yyval.node = makeCascadedMessage(yyvsp[-1].node, yyvsp[0].node); ;
  894.     break;}
  895. case 94:
  896. #line 400 "mst.y"
  897. { yyval.node = makeMessageList(yyvsp[0].node); ;
  898.     break;}
  899. case 95:
  900. #line 402 "mst.y"
  901. { addNode(yyvsp[-2].node, makeMessageList(yyvsp[0].node));
  902.                       yyval.node = yyvsp[-2].node; ;
  903.     break;}
  904. case 96:
  905. #line 407 "mst.y"
  906. { yyval.node = makeUnaryExpr(nil, yyvsp[0].sval); ;
  907.     break;}
  908. case 97:
  909. #line 409 "mst.y"
  910. { yyval.node = makeBinaryExpr(nil, yyvsp[-1].sval, yyvsp[0].node); ;
  911.     break;}
  912. case 98:
  913. #line 411 "mst.y"
  914. { yyval.node = makeKeywordExpr(nil, yyvsp[0].node); ;
  915.     break;}
  916. }
  917.    /* the action file gets copied in in place of this dollarsign */
  918. #line 327 "bison.simple"
  919.  
  920.   yyvsp -= yylen;
  921.   yyssp -= yylen;
  922. #ifdef YYLSP_NEEDED
  923.   yylsp -= yylen;
  924. #endif
  925.  
  926. #if YYDEBUG != 0
  927.   if (yydebug)
  928.     {
  929.       short *ssp1 = yyss - 1;
  930.       fprintf (stderr, "state stack now");
  931.       while (ssp1 != yyssp)
  932.     fprintf (stderr, " %d", *++ssp1);
  933.       fprintf (stderr, "\n");
  934.     }
  935. #endif
  936.  
  937.   *++yyvsp = yyval;
  938.  
  939. #ifdef YYLSP_NEEDED
  940.   yylsp++;
  941.   if (yylen == 0)
  942.     {
  943.       yylsp->first_line = yylloc.first_line;
  944.       yylsp->first_column = yylloc.first_column;
  945.       yylsp->last_line = (yylsp-1)->last_line;
  946.       yylsp->last_column = (yylsp-1)->last_column;
  947.       yylsp->text = 0;
  948.     }
  949.   else
  950.     {
  951.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  952.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  953.     }
  954. #endif
  955.  
  956.   /* Now "shift" the result of the reduction.
  957.      Determine what state that goes to,
  958.      based on the state we popped back to
  959.      and the rule number reduced by.  */
  960.  
  961.   yyn = yyr1[yyn];
  962.  
  963.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  964.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  965.     yystate = yytable[yystate];
  966.   else
  967.     yystate = yydefgoto[yyn - YYNTBASE];
  968.  
  969.   goto yynewstate;
  970.  
  971. yyerrlab:   /* here on detecting error */
  972.  
  973.   if (! yyerrstatus)
  974.     /* If not already recovering from an error, report this error.  */
  975.     {
  976.       ++yynerrs;
  977.       yyerror("parse error");
  978.     }
  979.  
  980.   if (yyerrstatus == 3)
  981.     {
  982.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  983.  
  984.       /* return failure if at end of input */
  985.       if (yychar == YYEOF)
  986.     YYABORT;
  987.  
  988. #if YYDEBUG != 0
  989.       if (yydebug)
  990.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  991. #endif
  992.  
  993.       yychar = YYEMPTY;
  994.     }
  995.  
  996.   /* Else will try to reuse lookahead token
  997.      after shifting the error token.  */
  998.  
  999.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1000.  
  1001.   goto yyerrhandle;
  1002.  
  1003. yyerrdefault:  /* current state does not do anything special for the error token. */
  1004.  
  1005. #if 0
  1006.   /* This is wrong; only states that explicitly want error tokens
  1007.      should shift them.  */
  1008.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1009.   if (yyn) goto yydefault;
  1010. #endif
  1011.  
  1012. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1013.  
  1014.   if (yyssp == yyss) YYABORT;
  1015.   yyvsp--;
  1016.   yystate = *--yyssp;
  1017. #ifdef YYLSP_NEEDED
  1018.   yylsp--;
  1019. #endif
  1020.  
  1021. #if YYDEBUG != 0
  1022.   if (yydebug)
  1023.     {
  1024.       short *ssp1 = yyss - 1;
  1025.       fprintf (stderr, "Error: state stack now");
  1026.       while (ssp1 != yyssp)
  1027.     fprintf (stderr, " %d", *++ssp1);
  1028.       fprintf (stderr, "\n");
  1029.     }
  1030. #endif
  1031.  
  1032. yyerrhandle:
  1033.  
  1034.   yyn = yypact[yystate];
  1035.   if (yyn == YYFLAG)
  1036.     goto yyerrdefault;
  1037.  
  1038.   yyn += YYTERROR;
  1039.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1040.     goto yyerrdefault;
  1041.  
  1042.   yyn = yytable[yyn];
  1043.   if (yyn < 0)
  1044.     {
  1045.       if (yyn == YYFLAG)
  1046.     goto yyerrpop;
  1047.       yyn = -yyn;
  1048.       goto yyreduce;
  1049.     }
  1050.   else if (yyn == 0)
  1051.     goto yyerrpop;
  1052.  
  1053.   if (yyn == YYFINAL)
  1054.     YYACCEPT;
  1055.  
  1056. #if YYDEBUG != 0
  1057.   if (yydebug)
  1058.     fprintf(stderr, "Shifting error token, ");
  1059. #endif
  1060.  
  1061.   *++yyvsp = yylval;
  1062. #ifdef YYLSP_NEEDED
  1063.   *++yylsp = yylloc;
  1064. #endif
  1065.  
  1066.   yystate = yyn;
  1067.   goto yynewstate;
  1068. }
  1069. #line 415 "mst.y"
  1070.  
  1071. /*     
  1072. ADDITIONAL C CODE
  1073. */
  1074.  
  1075.